﻿<?php
    include_once("../db_config.php");
    session_start();
    //检测是否登录，若没登录则转向登录界面
    if(!isset($_SESSION['userid'])){
        header("Location:../");
        exit();
    }
?>
<!DOCTYPE html>
<html lang="<?php echo $lang;?>">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="">
        <meta name="author" content="ysfl" >
        <link rel="icon" href="../img/favicon.ico">
        <title><?php echo $name; echo $title;?>
        </title>
        <link href="../css/bootstrap.min.css" rel="stylesheet">
        <link href="../css/dashboard.css" rel="stylesheet">
        <!--[if lt IE 9]>
        <script src="../js/ie8-responsive-file-warning.js"></script>
        <![endif]-->
        <!--[if lt IE 9]>
        <script src="../js/html5shiv.min.js"></script>
        <script src="../js/respond.min.js"></script>
        <![endif]-->
    </head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">切换导航</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            </button>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#"><?php echo ''.$_SESSION["level"].':'.$_SESSION["username"].''; ?></a></li>
                <li><a href="../">回到主页</a></li>
                <li><a href="./user.php">个人中心</a></li>
            </ul>
            <!--
            <form class="navbar-form navbar-right">
                <input type="text" class="form-control" placeholder="搜索...">
            </form>
            -->
        </div>
    </div>
</nav>
<div class="container-fluid">
    <div class="row">
        <!-- 导航条 -->
        <div class="col-sm-3 col-md-2 sidebar" role="tablist" id="myTab">
            <ul class="nav nav-sidebar">
                <div class="list-group">
                  <strong href="#" class="list-group-item list-group-item-info" style="font-size: 1.3em;background-color: #A5FFFC;">
                    后台管理
                  </strong>
                  <a href="#info" role="tab" data-toggle="tab" class="list-group-item" >概述</a>
                  <?php
                    if ($_SESSION["user_level"] == 10) {
                       echo '<a href="#personnel" role="tab" data-toggle="tab" class="list-group-item">员工管理</a>';
                   }
                ?>
                </div>
                <?php
                /*if ($_SESSION["user_level"] == 100 || $_SESSION["user_level"] == 10) {
                    echo '
                <div class="list-group">
                  <strong href="#" class="list-group-item list-group-item-info" id="kcgl" style="font-size: 1.3em;">
                    库存管理
                  </strong>
                    <div id="kcgl-info" style="display:none;">
                        <a href="#lease" role="tab" data-toggle="tab" class="list-group-item">物品租借管理</a>
                        <a href="#inventory" role="tab" data-toggle="tab" class="list-group-item">库存表</a>
                    </div>
                </div>
                <div class="list-group">
                  <strong href="#" class="list-group-item list-group-item-danger" id="lsz" style="font-size: 1.3em;">
                    流水帐
                  </strong>
                  <div id="lsz-info" style="display:none;">
                      <a href="#bill_bailu" role="tab" data-toggle="tab" class="list-group-item">白露</a>
                      <a href="#bill_min" role="tab" data-toggle="tab" class="list-group-item">超小店</a>
                      <a href="#bill_expend" role="tab" data-toggle="tab" class="list-group-item">支出</a>
                      <a href="#xrk_kill" role="tab" data-toggle="tab" class="list-group-item">奖惩栏</a>
                  </div>
                </div>
                <div class="list-group">
                  <strong href="#" class="list-group-item list-group-item-warning" id="khxx" style="font-size: 1.3em;">
                    客户信息
                  </strong>
                    <div id="khxx-info" style="display:none;">
                        <a href="#kh_zj" role="tab" data-toggle="tab" class="list-group-item">装机客户</a>
                        <a href="#kh_pt" role="tab" data-toggle="tab" class="list-group-item">普通消费客户</a>
                        <a href="#" role="tab" data-toggle="tab" class="list-group-item disabled">监控客户</a>
                        <a href="#" role="tab" data-toggle="tab" class="list-group-item disabled">企业客户</a>
                    </div>
                </div>
                <div class="list-group">
                  <strong href="#" class="list-group-item list-group-item-success" id="qt" style="font-size: 1.3em;">
                    其他
                  </strong>
                    <div id="qt-info" style="display:none;">
                      <a href="#query" role="tab" data-toggle="tab" class="list-group-item">日程表</a>
                      <a href="#gys" role="tab" data-toggle="tab" class="list-group-item">供应商管理</a>
                      <a href="#" role="tab" data-toggle="tab" class="list-group-item disabled">软件管理 　<span style="color:rgb(255, 120, 120);">(装修中……)</span></a>
                      <a href="#" role="tab" data-toggle="tab" class="list-group-item disabled">装机配置管理 　<span style="color:rgb(255, 120, 120);">(装修中……)</span></a>
                    </div>
                </div>
                ';}*/
                        if ($_SESSION["user_level"] == 2 || $_SESSION["user_level"] == 10 ) {
                            echo '
                <div class="list-group">
                  <strong href="#" class="list-group-item list-group-item-danger" id="long_kd" style="font-size: 1.3em; background-color:#99DAF2;">
                    长城宽带
                  </strong>
                    <div id="kd-info" style="display:none;">
                                <a href="#gwbn_yxkh" role="tab" data-toggle="tab" class="list-group-item">意向客户信息</a>
                                <a href="#gwbn_azkh" role="tab" data-toggle="tab" class="list-group-item">已安装客户信息</a>
                                <a href="#gwbn_query" role="tab" data-toggle="tab" class="list-group-item">日程表</a>
                            ';
                        }
                    ?>
                    </div>
                </div>
            </ul>
        </div>
        <!-- 导航条内容 -->
        <div class="tab-content">
            <?php # 概述 ?>
            <div class="tab-pane active" id="info">
                <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
                    <h1 class="page-header">欢迎来到向日葵电脑后台管理中心</h1>

                    <div class="row placeholders">
                    <?php // 长城业绩
                    if ($_SESSION["user_level"] == 2 || $_SESSION["user_level"] == 10) {?>
                        <div class="inner cover">
                            <div class="col-md-4 plank">
                                <div class="panel panel-default">
                                  <div class="panel-heading">
                                    <h3 class="">公告栏</h3>
                                    <div style="margin-left: 200px;margin-top: -40px;">
                                        <a class="btn btn-success" data-toggle="modal" data-target="#gwbn_disk">添加</a>
                                        <div class="modal fade" id="gwbn_disk" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                      <div class="modal-dialog">
                                        <div class="modal-content">
                                          <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                            <h4 class="modal-title">填写内容</h4>
                                          </div>
                                          <div class="modal-body">
                                            <input type="text" class="form-control" id="gwbn_disk_var" placeholder="请填写不能贴广告的地方">
                                          </div>
                                          <div class="modal-footer">
                                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                            <button type="button" class="btn btn-primary" id="gwbn_diskadd" onclick="gwbn_disk_add();">提交</button>
                                          </div>
                                        </div><!-- /.modal-content -->
                                      </div><!-- /.modal-dialog -->
                                    </div><!-- /.modal -->
                                    </div>
                                  </div>
                                  <div class="panel-body">
                                    <ul class="list-group">
                                     <li class="list-group-item active">
                                        不能贴广告的地方
                                      </li>
                                      <div id="gwbn-disk-info">
                                      <?php gwbn_disk_query(); ?>
                                      </div>
                                    </ul>
                                  </div>
                                </div>
                            </div>
                        </div>
                        <?php }?>
                    </div>
                </div>
            </div>

            <?php # 员工管理 ?>
            <?php
                if ($_SESSION["user_level"] == 10 || $_SESSION["user_level"] == 10) {
                    include_once("personnel/index.php");
                }
            ?>
            

            <?php # 长城宽带 意向客户信息 ?>
                <div class="tab-pane" id="gwbn_yxkh">
                    <?php
                        if ($_SESSION["user_level"] == 2 || $_SESSION["user_level"] == 10) {
                            include_once("./gwbn_yxkh/index.php");
                        }
                    ?>
                </div>

            <?php # 已安装客户信息 ?>
                <div class="tab-pane" id="gwbn_azkh">
                    <?php 
                    if($_SESSION["user_level"] == 2 ||$_SESSION["user_level"] == 10){
                        include_once("./gwbn_azkh/index.php"); 
                    }
                    ?>
                </div>

            <?php # 长城宽带 日程表 ?>
                <div class="tab-pane" id="gwbn_query">
                    <?php
                        if ($_SESSION["user_level"] == 2 || $_SESSION["user_level"] == 10) {
                            include_once("./gwbn_query/index.php");
                        }
                    ?>
                </div>
        </div>
    </div>
</div>
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/ie10-viewport-bug-workaround.js"></script>
<script src="../js/ie-emulation-modes-warning.js"></script>
<script src="../js/jquery.function.js"></script>
</body>
</html>
